package com.example.controller;

import com.alibaba.fastjson.JSONObject;
import com.example.ribbon.service.NodeService;
import com.example.util.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
public class TestController {

    @Autowired
    private NodeService nodeService;

    @GetMapping("/info")
    public JSONObject testController() {
       return Results.success("node server");
    }

    @GetMapping("/test")
    public JSONObject testController2() {
        return nodeService.testInfo("cloud-nodeserver");
    }
}
